Add Data Row
AutomatR.DefaultActivities.Datatable.AddDataRow
The "Add Data Row" activity in AutomatR is part of the DataTable activities package, designed to facilitate the addition of a data row to a specified DataTable. This activity provides flexibility in defining the characteristics of the new row, such as specifying a DataRow object, an array of objects corresponding to column types, and the index at which the row should be inserted.
Properties
Name | Description |
---|---|
Input | |
Data Table | Specifies the DataTable variable to which a new row has to be added. DataTable variables containing the target DataTable. |
Row | Specifies a DataRow object to be added as a row. DataRow variables containing the definition of the row to be added. |
Row List | Specifies an array of objects to be added to the DataTable, where each object maps to the type of its corresponding column in the DataTable. ArrayList variables containing the values to be added to the new row. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Add Data Row" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Insert At | Specifies the index at which the new row should be inserted. Integer variables containing the index value. If not provided, the row will be added at the end of the DataTable. |
How to use:
- Drag and drop the "Add Data Row" activity onto the workflow.
- Configure the properties by specifying the DataTable variable, DataRow object, or an array of objects for the new row.
- Optionally, configure the delay and specify the index at which the new row should be inserted.
- Execute the workflow to add the specified row to the DataTable.
Example: Consider an example where the "Add Data Row" activity is used to add a new row to an existing DataTable:
Add Data Row:
Data Table: existingDataTable
Row:
- Column1: "Value1"
- Column2: "Value2"
- Column3: "Value3"
Insert At: 2
In this example, the activity adds a new row to the "existingDataTable" DataTable, specifying the values for each column in the row. The new row is inserted at index 2 in the DataTable. Adjust the input properties as needed to accommodate various scenarios in your automation workflows.